package com.ningxia.water.controller.report;

import com.ningxia.water.reuslt.Result;
import com.ningxia.water.reuslt.ResultResponse;
import com.ningxia.water.service.IZtTownInfoService;
import com.ningxia.water.vo.out.ReportVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/townreport")
@Api(tags = "报表管理-乡镇报表")
public class TownReportControlle {
    @Autowired
    private IZtTownInfoService townInfoService;

    @GetMapping("/gettownreport")
    @ApiOperation("获取乡镇报表数据")
    public Result getTownReport(@RequestParam String type, @RequestParam String currentTime){
        List<ReportVo> list = townInfoService.getTownReport(type, currentTime);
        return ResultResponse.getSuccessResult(list);
    }
}
